home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / MoreHardware / GALer20.lha / GALer20 / Examples / Counter.pld < prev    next >
Encoding:
Text File  |  1995-10-07  |  1.0 KB  |  53 lines

  1. GAL16V8    ; 4-Bit-Counter  first line : used GAL
  2. Counter    ;                second line: any text (max. 8 char.)
  3.  
  4.  
  5. Clock D0    D1    D2    D3    Set   Clear NC    NC   GND
  6. /OE   NC    NC    NC    NC    Q3    Q2    Q1    Q0   VCC
  7.  
  8.  
  9.  
  10.  
  11.  
  12. Q0.R =   /Clear *  Set *  D0
  13.        + /Clear * /Set * /Q0
  14.  
  15.  
  16. Q1.R =   /Clear *  Set *  D1
  17.        + /Clear * /Set * /Q1 *  Q0
  18.        + /Clear * /Set *  Q1 * /Q0
  19.  
  20.  
  21. Q2.R =   /Clear *  Set *  D2
  22.        + /Clear * /Set *  Q2 * /Q1
  23.        + /Clear * /Set *  Q2 * /Q0
  24.        + /Clear * /Set * /Q2 *  Q1 *  Q0
  25.  
  26.  
  27. Q3.R =   /Clear *  Set *  D3
  28.        + /Clear * /Set *  Q3 * /Q2
  29.        + /Clear * /Set *  Q3 * /Q1
  30.        + /Clear * /Set *  Q3 * /Q0
  31.        + /Clear * /Set * /Q3 *  Q2 *  Q1 *  Q0
  32.  
  33.  
  34.  
  35.  
  36.  
  37. DESCRIPTION
  38.  
  39. this is a 4-Bit-Counter
  40.  
  41. registered outputs are signed with the postfix .R
  42.  
  43.  
  44.  Pin 'Set' HIGH while clock signal (LOW-HIGH) at pin 'Clock':
  45.         load Q0-Q3 with state of D0-D3
  46.  
  47.  Pin 'Clear' HIGH while clock signal:
  48.         Q0-Q3 are cleared
  49.  
  50.  Clock signal while pins 'Set' and 'Clear' are LOW:
  51.         increment counter
  52.  
  53.